<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="shortcut icon" href="http://7xkzac.com2.z0.glb.qiniucdn.com/fahailogo.png" type="image/x-icon"/>

    <title>律师管理 </title>

    <link rel="stylesheet" href="/assets/css/lib/bootstrap.min.css">
    <link rel="stylesheet" href="/assets/css/lib/pagination.css">

    <link rel="stylesheet" href="/assets/css/common.css">
    <link rel="stylesheet" href="/assets/css/lawyer_manage.css">

</head>
<body>
<div  id="cms">
    <jsp:include page="title_bar.jsp"/>
    <jsp:include page="tab_bar.jsp"/>
    <div class="cms-content">
        <div class="current-place">
            <div class="place-title">当前位置:</div>
            <div class="place-val">首页/律师管理</div>
        </div>
        <div class="seek-box">

            <form id="myForm">

                <!--存放着排序的值-->
                <input type="hidden" name="lawyerStates" value=-1 id="lawyerStates_hidden" />

                <input type="hidden" name="isValid" value=-1 id="isValid_hidden" />

            <div class="common-title">
                <div class="common-left-line"></div>
                <div class="common-text">条件查询</div>
            </div>
            <div class="seek-content">
                <div class="seek-group">
                    <div class="seek-unit">
                        <span class="seek-unit-left">律师姓名</span>
                        <div class="seek-unit-right">
                            <input name="lawyername" type="text" class="form-control lawyer-name">
                        </div>
                    </div>
                    <div class="seek-unit">
                        <span class="seek-unit-left">手机号码</span>
                        <div class="seek-unit-right">
                            <input name="lawyerPhone" type="text" class="form-control phone-num">
                        </div>
                    </div>
                    <div class="seek-unit">
                        <span class="seek-unit-left">律师服务地区</span>
                        <div class="seek-unit-right">
                            <div id="distpicker1" class="distpicker">
                                <div class="form-group">
                                <select class="form-control province" ></select>
                            </div>
                                <div class="form-group">
                                    <select class="form-control city"></select>
                                </div>
                                <div class="form-group">
                                    <select class="form-control district"></select>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="seek-group">
                    <div class="seek-unit">
                        <span class="seek-unit-left">账号创建时间</span>
                        <div class="seek-unit-right">
                            <input name="createTimeBegin" type="text" class="Wdate " id="create-start"/>
                            <span>-</span>
                            <input name="createTimeEnd" type="text" class="Wdate " id="create-end"/>
                        </div>
                    </div>
                    <div class="seek-unit">
                        <span class="seek-unit-left">客户服务数</span>
                        <div class="seek-unit-right">
                            <input name="allUsersMin" type="tel" pattern="[0-9]*" class="form-control start-num">
                            <span>-</span>
                            <input name="allUsersMax" type="tel" pattern="[0-9]*" class="form-control end-num">
                        </div>
                    </div>
                </div>
                <div class="seek-group">
                    <div class="seek-unit">
                        <span class="seek-unit-left">擅长领域</span>
                        <div class="seek-unit-right goodat">
                             <c:forEach items="${skills}" var="skill" varStatus="i">
                                 <input  name="preferFieldList" type="checkbox" value=${skill.skillId} id="skill${i.index}"/><label for="skill${i.index}">${skill.skillName}</label>
                             </c:forEach>
                        </div>
                    </div>
                </div>
                <div class="seek-group">
                    <div class="seek-unit service">
                        <span class="seek-unit-left ">服务平台</span>
                        <div class="seek-unit-right">
                            <c:forEach items="${plats}" var="plat" varStatus="i">
                                <input name="platformList"  type="checkbox" value=${plat.proid} id="plat${i.index}"/><label for="plat${i.index}">${plat.pro_name}</label>
                            </c:forEach>
                        </div>
                    </div>
                    <div class="seek-unit">
                        <div class="seek-unit-left seek-btn" >
                            查询
                        </div>
                        <div class="seek-unit-right seek-clear">
                            清空条件
                        </div>
                        <div class="seek-unit-right seek-xls" style="display: none">
                            导出excel
                        </div>
                    </div>
                </div>

            </div>

            </form>
        </div>
        <div class="table-box"><table class="table table-bordered">
                <thead>
                <tr>
                    <th></th>
                    <th style="min-width: 60px;">
                        <div>姓名</div>
                    </th>
                    <th>
                        <div>手机号</div>
                    </th>
                    <th><div>服务地区</div></th>
                    <th class="create-time sequence isdown" style="min-width: 120px">
                        <div>
                            <span>账号创建时间</span>
                            <img src="/assets/images/up.png" class="up">
                            <img src="/assets/images/down.png" class="down">
                            <img src="/assets/images/default_status.png" class="default">
                        </div>

                    </th>
                    <th class="service-client-num sequence " style="min-width: 120px">
                        <div>
                            <span>服务客户数</span>
                            <img src="/assets/images/up.png" class="up">
                            <img src="/assets/images/down.png" class="down">
                            <img src="/assets/images/default_status.png" class="default">
                        </div>

                    </th>
                    <th><div>擅长领域</div></th>
                    <th><div>个人优势</div></th>
                    <th><div>服务平台</div></th>
                    <th><div>社会荣誉</div></th>
                    <th class="service_box">
                        <div>
                            <span>服务状态</span>
                            <select id="lawyerStates" class="form-control service_status" onchange="order_by(0)">
                                <option value=-1>全部</option>
                                <option value=1>上线</option>
                                <option value=0>下线</option>
                            </select>
                        </div>
                    </th>
                    <th class="account_box">
                        <div>
                            <span>账号状态</span>
                            <select id="isValid" class="form-control account_status" onchange="order_by(1)">
                                <option value=-1>全部</option>
                                <option value=1>正常</option>
                                <option value=2>冻结</option>
                                <option value=0>未审核</option>
                            </select>
                        </div>
                    </th>
                    <th style="min-width: 110px">
                        <div>操作</div></th>
                </tr>
                </thead>

                <tbody id="list">

                </tbody>

            <!--列表遍历开始-->

                <script id="list_temp" type="text/html">

                      <!for(k in result){

                         var v=result[k];
                      !>

                      <tr>

                          <td><input value=<!=v.lawyerid!> type="checkbox" class="check-unit"/></td>

                          <td><a href="/lawyer/findLawyerDetailInfo?lawyerid=<!=v.lawyerid!>"><!=v.lawyername!></a></td>

                          <td><!=v.lawyerPhone!></td>

                          <td><!=v.fwdq!></td>

                          <td><!= getFormatDate(v.createtime) !></td>

                          <td><!=v.servicenum!></td>

                          <td><!=v.scly==null ?'':v.scly!></td>
                          <td><!=v.grys ==null?'':v.grys!></td>
                          <td><!=v.fwpt==null?'':v.fwpt!></td>
                          <td><!=v.shry==null?'':v.shry!></td>

                          <%--<td><!=v.advExp!>/<!=v.advIdn!>/<!=v.advDeg!></td>

                          <td><!=v.platform!></td>

                          <td><!=v.societyHoner!></td>
                          --%>

                          <td class="lawyerStates"><!=    (v.lawyerStates!=1?'下线':'上线'  ) !></td>

                          <td><!=back_tmpl(v.isValid)!></td>

                          <td>

                              <!if(role==0){!>

                              <div class="down-thread common-thread  <!=v.lawyerStates!=1?'up-thread':''!>" data-value=<!=v.lawyerid!> ><!=v.lawyerStates!=1?'上线':'下线'!></div>

                              <div class="edit-btn"  onclick="openEdit(this)" data-value=<!=v.lawyerid!>   >编辑</div>
                               <!}!>
                          </td>

                      </tr>


                      <!}!>

                </script>
                <!--列表遍历结束-->



            </table>

            <div class="table-bottom clearfix">
                <div class="check-all">
                    <input type="checkbox" id="check-all">
                    <label for="check-all">全选</label>
                </div>
                <div class="freeze" name="roleMenu">批量冻结</div>
                <div class="unfreeze" name="roleMenu">批量解冻</div>
                <div id="Pagination" class="pagination"><!-- 这里显示分页--></div><span id="currentCount"    ></span>
            </div>
        </div>

    </div>
</div>

</div>
<div class="cms-modal-ms" id="freeze-info">
    <div class="cms-modal-dialog">
        <div class="cms-modal-title">操作提醒</div>
        <div class="cms-madal-content">
            <div class="freeze-quesition"> 确定要将选中的12个用户冻结吗?</div>
            <div class="freeze-info">冻结后客户将不能实现咨询、关注律师、更换专属律师 、充值等功能。</div>
        </div>
        <div class="cms-modal-bottom">
            <button type="button" class="cms-confirm freeze-confirm">确定</button>
            <button type="button" class="cms-cancel freeze-cancel">取消</button>
        </div>
    </div>
</div>
<!--上下线控制-->
<div class="cms-modal-ms" id="thread">
    <div class="cms-modal-dialog">
        <div class="cms-modal-title">操作提醒</div>
        <div class="cms-madal-content">
            <div class="thread-quesition"> 确定要将该律师上线吗?</div>
        </div>
        <div class="cms-modal-bottom">
            <button type="button" class="cms-confirm thread-confirm">确定</button>
            <button type="button" class="cms-cancel thread-cancel">取消</button>
        </div>
    </div>
</div>
<div class="cms-modal-lg" id='edit-material'>
    <div class="cms-modal-dialog">
        <div class="cms-modal-title">编辑信息</div>
        <div class="cms-madal-content" id="lawyer_temp_div">

        </div>


        <!--编辑页面开始-->

        <script id='lawyer_temp' type="text/html">

        <div class="state-unit">
            <div class="two-stage">
                <div class="state-left not-edit">姓名</div>
                <div class="state-right">
                    <!=lawyerInfo.lawyername!>
                </div>
            </div>
            <div class="two-stage">
                <div class="state-left not-edit">手机号</div>
                <div class="state-right edit-client-phone"><!=lawyerInfo.lawyerPhone!></div>
            </div>
        </div>


        <div class="state-unit">
            <div class="two-stage">
                <div class="state-left not-edit">律师状态</div>
                <div class="state-right">
                    <select class="form-control province" id="edit_is_valid">
                        <!if(lawyerInfo.isValid==0){!> <option value=0  selected>待审核</option> <!}else{!>  <!}!>
                        <!if(lawyerInfo.isValid==1){!> <option value=1  selected>正常</option> <!}else{

                        !> <option value=1>正常</option> <!}!>
                        <!if(lawyerInfo.isValid==2){!> <option value=2  selected>冻结</option> <!}else{!> <option value=2>冻结</option> <!}!>
                    </select>
                </div>
            </div>

        </div>


        <div class="state-unit edit-service">
            <div class="two-stage">
                <div class="state-left">服务平台</div>
                <div class="state-right">

                    <c:forEach items="${plats}" var="plat" varStatus="i">

                        <!

                           var is_chcked=0;

                           for(k in lawyerSkill){

                              var v=lawyerSkill[k];

                              if(k==31){


                                        for(j in v){

                                               if(j==${plat.proid}){

                                                    is_chcked=1;

                                                     break;

                                                }

                                         }


                                 }

                            }


                        !>

                      <!--  <input    name="edit_plate"   type="checkbox"   <!if(is_chcked){!> checked="checked" <!}!>    value=${plat.proid} id="edit-${i.index}"/><label for="edit-${i.index}">${plat.pro_name}</label> -->

                        <input    name="edit_plate"    type="checkbox"  id="edit-${i.index}"    <!if(is_chcked){!> checked="checked"  <c:if test="${i.index==0}">  readonly="readonly" onclick="return false;" </c:if>    <!}!>         value=${plat.proid}  /><label for="edit-${i.index}" >${plat.pro_name}</label>

                    </c:forEach>


                </div>
            </div>
        </div>




        <div class="state-unit">
            <div class="two-stage">
                <div class="state-left">个人优势</div>
                <div class="state-right edit-advantage">
                    <select class="form-control edit-advantage-one required edit_advantage" name="edit_advantage">
                        <option value ></option>

                        <c:forEach items="${advantage}" var="skill">


                            <c:if test="${skill.skill_type==21}">



                                <!

                                var is_checked=0;

                                for(k in lawyerSkill[21]){

                                var v=lawyerSkill[21][k];

                                console.log(k==${skill.skill_id});

                                if(k==${skill.skill_id}){


                                is_checked=1;


                                break;

                                }


                                }!>




                                <option value="${skill.skill_id}-${skill.skill_type}"   <!if(is_checked==1){!>  selected="selected" <!}!> >${skill.skill_name}</option>




                            </c:if>


                        </c:forEach>



                    </select>
                    <select class="form-control edit-advantage-two required edit_advantage" name="edit_advantage2">
                        <option value ></option>


                        <c:forEach items="${advantage}" var="skill">


                            <c:if test="${skill.skill_type==22}">



                                <!

                                console.log(JSON.stringify(lawyerSkill[21]));

                                var is_checked=0;

                                for(k in lawyerSkill[21]){

                                var v=lawyerSkill[21][k];

                                console.log(k==${skill.skill_id});

                                if(k==${skill.skill_id}){


                                is_checked=1;


                                break;

                                }


                                }!>




                                <option value="${skill.skill_id}-${skill.skill_type}"   <!if(is_checked==1){!>  selected="selected" <!}!> >${skill.skill_name}</option>




                            </c:if>


                        </c:forEach>


                    </select>
                    <select class="form-control edit-advantage-three required edit_advantage" name="edit_advantage3">
                        <option value ></option>

                        <c:forEach items="${advantage}" var="skill">


                            <c:if test="${skill.skill_type==23}">



                               <!

                                console.log(JSON.stringify(lawyerSkill[21]));

                                var is_checked=0;

                                for(k in lawyerSkill[21]){

                                var v=lawyerSkill[21][k];

                                console.log(k==${skill.skill_id});

                                if(k==${skill.skill_id}){


                                    is_checked=1;


                                    break;

                                 }


                                }!>




                                <option value="${skill.skill_id}-${skill.skill_type}"   <!if(is_checked==1){!>  selected="selected" <!}!> >${skill.skill_name}</option>




                            </c:if>


                        </c:forEach>

                    </select>
                </div>
            </div>
        </div>




        <!for(var key in lawyerSkill){!>

        <!if(key==6){!>

        <div class="state-unit edit-honour">
            <div class="two-stage">
                <div class="state-left">社会荣誉</div>
                <div class="state-right clearfix">

                   <div  id="s_h_r_y">
                    <!for(var kc in lawyerSkill[key]){!>

                    <div>
                        <input name="edit_honor" maxlength="10" type="text" class="form-control" data-value=<!=kc!> value=<!=lawyerSkill[key][kc]!> />
                    </div>

                    <!}!>
                   </div>

                    <div class="add-btn" onclick="add_input()" >
                        <img src="/assets/images/edit_add.png">
                        <span>添加</span>
                    </div>
                </div>
            </div>
        </div>

          <!}!>

        <!}!>


        <div>状态修改为冻结后客户将不能实现咨询、关注律师、更 换专属律师、充值等行为。</div>


        <div class="cms-modal-bottom">
            <button type="button" class="cms-confirm edit-confirm" data-value=<!=lawyerInfo.lawyerid!> onclick="save_edit_data(this);">确定</button>
            <button type="button" class="cms-cancel edit-cancel" onclick="$('#edit-material').cmsmodal('hide');">取消</button>
        </div>
        </script>

        <!--结束-->


    </div>
</div>
</body>
<script type="text/javascript" src="/assets/js/lib/jquery-1.12.3.js"></script>
<script type="text/javascript" src="/assets/js/lib/bootstrap.min.js"></script>
<script type="text/javascript" src="/assets/js/lib/modal.js"></script>
<script type="text/javascript" src="/assets/js/lib/cmsmodal.js"></script>
<script type="text/javascript" src="/assets/js/lib/distpicker.data.js"></script>
<script type="text/javascript" src="/assets/js/lib/distpicker.js"></script>
<script type="text/javascript" src="/assets/js/lib/jquery.pagination.js"></script>
<script type="text/javascript" src="/assets/js/lib/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript" src="/assets/js/common.js"></script>
<script type="text/javascript" src="/assets/js/communal/template.js"></script>

<script type="text/javascript" src="/assets/js/lawyer_manage.js"></script>
</html>